function alertbox($skin){
	var callback_func;
	$skin.find(".truebtn").click(function(){
//								alert(callback_func);
								if (callback_func)
									callback_func();
								
								$skin.hide();	
							});
	$skin.find(".falsebtn").click(function(){

								$skin.hide();	
							});
							
	//自定义alert
	this.showAlert=function(title,content,callback){
		
//		$skin.find(".alerttitle").html(title);
//		$skin.find(".alertcontent").html(content);
//		$skin.show();
//		if (callback){
//			callback_func=callback;
//		}
		if (confirm(content)){
			callback();
		};
	}
	
	this.closeAlert= function(){
		$skin.hide();
	}
	
	
}

var html_static_link_class={
	set_link_extend:function(param){
		var current_href=self.location.href;
		var param_str=current_href.split("?");
		var params_obj=this.get_params(param_str[1]);
		var len=$("a").length;
		for (var i=0;i<len;i++){
			var old_href=$("a:eq("+i+")").attr("href");
			link_extend=this.check_link_exist(old_href)+param+"="+params_obj[param];
			$("a:eq("+i+")").attr("href",link_extend);
		}
	},
	check_link_exist:function(path_str){
		if (path_str.indexOf("?")<0) return path_str+"?"
		else return path_str+"&";
	},
	get_params:function(params_str){
		var return_object;
		var param_list=params_str.split("&");
		var len=param_list.length;
		for (var j=0;j<len;j++){
			var param_object=param_list[j].split("=");
			return_object[pram_object[0]]=param_object[1];
		}
		return return_object;
	}
}
function set_link_extend(){
	var current_href=self.location.href;
	var params=current_href.split("?");
	var param_str=params[1];
	var len=$("a").length;
	for (var i=0;i<len;i++){
		var old_href=$("a:eq("+i+")").attr("href");
		$("a:eq("+i+")").attr("href",old_href+"?"+param_str);
	}
}
function show_alert(strHtml, _w, _h) {
    var eSrc = (window.event) ? window.event.srcElement : arguments[1];//(document.all) ? window.event.srcElement : arguments[1];//
    var shield = document.createElement("DIV");
    shield.id = "shield";
    shield.style.position = "absolute";
    shield.style.left = "0px";
    shield.style.top = "0px";
    shield.style.width = "100%";
    shield.style.height = document.body.scrollHeight + "px";
    //shield.style.background = "#fff";
    shield.style.textAlign = "center";
    shield.style.zIndex = "10000";
    shield.style.filter = "alpha(opacity=0)";
    shield.style.opacity = 0;
    try{
    	shield.addEventListener('click', function(){
			doClose(); //点空白处关闭遮罩层
		});
    }catch (e) { }
	
    var alertFram = document.createElement("DIV");
    alertFram.id = "alertFram";
    alertFram.style.position = "absolute";
    alertFram.style.left = "45%";
    alertFram.style.top = parseInt(window.parent.parent.document.body.scrollTop)+parseInt(_h)/2+30+"px";
    alertFram.style.marginLeft = "-225px";
    alertFram.style.marginTop = -175 + document.documentElement.scrollTop + "px";
    alertFram.style.width = _w;
    alertFram.style.height = _h;
    alertFram.style.background = "#ccc";
    alertFram.style.textAlign = "center";
    alertFram.style.lineHeight = "150px";
    alertFram.style.zIndex = "10001";

    alertFram.innerHTML = strHtml;
    document.body.appendChild(alertFram);
    document.body.appendChild(shield);
    this.setOpacity = function (obj, opacity) {
        if (opacity >= 1) opacity = opacity / 100;
        try { obj.style.opacity = opacity; } catch (e) { }
        try {
            if (obj.filters.length > 0 && obj.filters("alpha")) {
                obj.filters("alpha").opacity = opacity * 100;
            } else {
                obj.style.filter = "alpha(opacity=\"" + (opacity * 100) + "\")";
            }
        } catch (e) { }
    }
    var c = 0;
    this.doAlpha = function () {
        if (++c > 20) { clearInterval(ad); return 0; }
        setOpacity(shield, c);
    }
    var ad = setInterval("doAlpha()", 1);
    this.doClose = function () {
        //alertFram.style.display = "none";
        //shield.style.display = "none";
        document.body.removeChild(alertFram);
        document.body.removeChild(shield);
        try{
      	  eSrc.focus(); //ie报错 LHY
        }catch (e){}
       // document.body.onselectstart = function () { return true; }
        document.body.oncontextmenu = function () { return true; }
    }
    //document.getElementById("do_close").focus();
    try{
  	  eSrc.blur(); //ie报错 LHY
    }catch (e){}
    //document.body.onselectstart = function () { return false; }
    document.body.oncontextmenu = function () { return false; }
}
